﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Domain.DAL
{
    public class OrderDetailsDAL
    {


        internal static void insertSingle(BLL.OrderDetailsBLL orderDetailsBLL)
        {
            using (var cs = new CSEntities())
            {
                var orderDetail = new OrderDetail();

                orderDetail.OrderID = orderDetailsBLL.OrderID;
                orderDetail.ProductID = orderDetailsBLL.ProductID;
                orderDetail.Price = orderDetailsBLL.UnitPrice;
                orderDetail.Quantity = (short)orderDetailsBLL.Quantity;

                cs.AddToOrderDetails(orderDetail);
                cs.SaveChanges();
            }
        }
    }
}
